#include <iostream>
#include <thread>
#include <string>

using namespace std;

void infinite_loop()
{
    int i = 0;
    for (;;){
        ++i;
    }
}

static const int CORE = 4;
std::unique_ptr<std::thread> thread_array [CORE];

string toHex(int num)
{
    if (num == 0) return "";
    const string digits = "0123456789abcdef";
    string sb;
    while (num && sb.size() < 8) {
        sb = digits[num & 0xf] + sb;
        num = num >> 4;
    }
    return sb;
}

string convertToBase7(int num) {
    if (num == 0) return "0";
    bool neg = num < 0;
    num = neg ? -num : num;
    string sb;
    while (num > 0) {
        sb.insert(0, 1, num % 7 + '0');
        num = num / 7;
    }
    return neg ? "-" + sb : sb;
}

int main()
{
    convertToBase7(100);
    toHex(26);
    for(int i = 0; i < CORE; ++i)
    {
        thread_array[i] = std::make_unique<std::thread>(infinite_loop);
    }
    for(int i = 0; i < CORE; ++i)
    {
        thread_array[i]->join();
    }
    return 0;
}